﻿using System;
using System.Collections.Generic;

using SBPweb.Forge.Contracts.Events;
using SBPweb.Forge.Contracts.Components;

using SBPweb.Communication.Shared.Library.Contacts;
using SBPweb.Communication.Shared.Library.Configuration;

namespace SBPweb.Communication.Shared.Library.Connections
{

    public interface IConnectionManager : IInitializable, IConfigurationDescriptorApplicant<IConnectionManagerConfiguration>
    {

        #region Property accessors

        //IMessenger Messenger
        //{
        //    get;
        //}

        bool IsConnected
        {
            get;
        }

        string UserName
        {
            get;
        }

        string Resource
        {
            get;
            set;
        }

        #endregion

        #region Events

        event EventHandler Connecting;
        
        event EventHandler Connected;

        event EventHandler<CancelEventArgs> Disconnecting;

        event EventHandler Disconnected;

        event EventHandler<ContactPresenceStateBaseCancelEventArgs> PresenceStateChanging;

        event EventHandler<ContactPresenceStateBaseEventArgs> PresenceStateChanged;

        #endregion

        #region Methods

        #region Connectivity

        void Connect(string userName, string password);

        void Disconnect();

        #endregion

        #region State management

        List<ContactPresenceStateBase> EnumeratePresenceStates();

        void SetPresenceState(ContactPresenceStateBase state);

        #endregion

        #endregion

    }
    
}